local fuju = fk.CreateSkill{
  name = "rfenghou_3d9j__fujuremove",
  tags = { Skill.Compulsory }
}

fuju:addEffect(fk.AfterCardsMove, {
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(fuju.name) then
      for _, move in ipairs(data) do
        if move.toArea == Card.DiscardPile and move.from == player then
          for _, info in ipairs(move.moveInfo) do
            if info.fromArea == Player.Equip then
              return true
            end
          end
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local choices = player:getAvailableEquipSlots()
    if #choices == 0 then return false end
    local choice = room:askToChoice(player, {choices = choices, skill_name = fuju.name, prompt = "#rfenghou_3d9j__fujuremove"})
    room:abortPlayerArea(player, choice)
  end
})
fuju:addEffect(fk.CardUseFinished, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(fuju.name) and player.hp - player.maxHp ~= 0 and
      data.card and data.card.type == Card.TypeBasic and data.card.trueName ~= "slash"
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, player.hp - player.maxHp)
  end
})

Fk:loadTranslationTable{
  ["rfenghou_3d9j__fujuremove"] = "浮遽",
  [":rfenghou_3d9j__fujuremove"] = "锁定技，你于装备区牌置入弃牌堆后废除一个装备栏；你于使用非【杀】的基本牌后将体力上限减至体力值。",

  ["#rfenghou_3d9j__fujuremove"] = "浮遽：你须废除一个装备栏",
}

return fuju
